package com.hqyj.mana.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hqyj.mana.dao.ContractManagementMapper;
import com.hqyj.mana.pojo.ContractManagement;
import com.hqyj.mana.service.ContractService;

@Service
public class ContractServiceImpl implements ContractService {
	@Autowired
	ContractManagementMapper mapper;
	@Override
	public List<ContractManagement> selectAllContract(String userName,String userId) {
		// TODO Auto-generated method stub
		List<ContractManagement> list = mapper.selectManagement(userName,userId);
		System.out.println(list.get(0).getContractId());
		return list;
		
	}
	@Override
	public boolean add(ContractManagement user) {
		//System.out.println(user.getBasicVage());
		if(mapper.insertSelective(user)>0){
			return true;
		}
		return false;
	}
	@Override
	public boolean update(ContractManagement user) {
		if(mapper.updateByPrimaryKey(user)>0){
			return true;
		}
		return false;
	}
	@Override
	public boolean del(Integer id) {
		if(mapper.deleteByPrimaryKey(id)>0){
			return true;
		}
		return false;
	}
	@Override
	public HashMap<String, Object> hashCode(Object user) {
		// TODO Auto-generated method stub
		return null;
	}
}
